﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true" CodeBehind="MaintenanceStaff_ValidateCarMaintenance.aspx.cs" Inherits="CS424_9pts.Administration.MaintenanceStaff_ValidateCarMaintenance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">

<asp:Label ID="ItemName" runat="server" Text="ContractID"></asp:Label>
    <asp:TextBox ID="txbContractID" runat="server" ></asp:TextBox>
  
    <asp:Button ID="btnValidateMaintenane" runat="server" 
        Text="ValidateMaintenane"  CssClass="adminButtonBlue" 
        onclick="btnValidateMaintenane_Click" />
        
        <asp:DataList ID="dataProvider" runat="server" Visible="false" DataSourceID="GetMaintenance">
            <asp:Label ID="spanTime" runat="server" Text='<%Eval("SpanTimeMaintenance") %>'> </asp:Label>
            <asp:Label ID="purchasedDate" runat="server" Text='<%Eval("DatePurchased") %>'> </asp:Label>
        </asp:DataList>
    

  <asp:SqlDataSource ID="GetMaintenace" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
    
        
        SelectCommand="SELECT Maintenance.SpanTimeMaintenace, Contract.DatePurchased FROM Maintenance INNER JOIN Contract ON Maintenance.ContractID = Contract.ContractID WHERE (Maintenance.ContractID = @ContractID)">
      <SelectParameters>
          <asp:ControlParameter ControlID="txbContractID" Name="ContractID" 
              PropertyName="Text" Type="Int32" />
      </SelectParameters>
    </asp:SqlDataSource>
    <asp:Label ID="lbValidate" runat="server" Text="Label"></asp:Label>

   <%-- <asp:SqlDataSource ID="InsertPromotion" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
        DeleteCommand="DELETE FROM [Promotion] WHERE [PromotionID] = @PromotionID" 
        InsertCommand="INSERT INTO [Promotion] ([Num], [Name]) VALUES (@Num, @Name)" 
        SelectCommand="SELECT [PromotionID], [Discount], [HasGift], [StartDate], [EndDate], [Status], [Num], [Name] FROM [Promotion] WHERE (([Num] = @Num) AND ([Name] = @Name))" 
        
        UpdateCommand="UPDATE [Promotion] SET [Discount] = @Discount, [HasGift] = @HasGift, [StartDate] = @StartDate, [EndDate] = @EndDate, [Status] = @Status, [Num] = @Num, [Name] = @Name WHERE [PromotionID] = @PromotionID">
        <DeleteParameters>
            <asp:Parameter Name="PromotionID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
               <asp:ControlParameter ControlID="txbNum" Name="Num" PropertyName="Text" 
                Type="Int32" />
            <asp:ControlParameter ControlID="txbItemName" Name="Name" PropertyName="Text" 
                Type="String" />
        </InsertParameters>
        <SelectParameters>
         
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Discount" Type="Double" />
            <asp:Parameter Name="HasGift" Type="Int32" />
            <asp:Parameter Name="StartDate" Type="DateTime" />
            <asp:Parameter Name="EndDate" Type="DateTime" />
            <asp:Parameter Name="Status" Type="Int32" />
            <asp:Parameter Name="Num" Type="Int32" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="PromotionID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>--%>

</asp:Content>
